package com.zbkj.common.exception;

import lombok.Getter;

/**
 * @Auther: liuxiaowei
 * @Date: 2022-4-1 12:56
 * @Description:
 */
public class ResultException extends RuntimeException implements ExceptionHandler {

    private long code;
    private String msg;

    public ResultException() {
        super();
    }

    public ResultException(long code,String msg){
        super(msg);
        this.code = code;
        this.msg = msg;
    }

    public ResultException(ExceptionCodeEnum codeEnum) {
        super(codeEnum.getMessage());
        this.code = codeEnum.getCode();
        this.msg = codeEnum.getMessage();
    }

    @Override
    public long getCode() {
        return this.code;
    }

    @Override
    public String getMessage() {
        return this.msg;
    }
}
